#include "junix.h"
#include <tr1/unordered_map>
using namespace std;

int main(int argc, char **argv)
{
	typedef std::tr1::unordered_map<std::string,int> MAP;
	MAP words;
	std::ifstream file("BIGTXT");
	std::string line, word;
	std::stringstream fmt;
	std::clock_t begt = clock();

	while (getline(file, line)) {
		fmt<<line;
		while (!fmt.eof()) {
			fmt>>word;
			++ words[word];
		}

		fmt.clear();
	}

	std::clock_t endt = clock();
	std::cout<<endt-begt<<std::endl;

	/*
	BOOST_FOREACH(MAP::value_type& s, words) {
		std::cout<<"("<<s.first<<","
			<<s.second<<")"<<std::endl;
	}
	*/

	return 0;
}
